﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;

public partial class user_writenote : Wozuji.Logic.PageLogin
{
    protected void Page_Load(object sender, EventArgs e)
    {
        Page.Header.Title = "足迹网 写日志";
    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        if (title.Text.Length<8)
        {
            Wozuji.Common.MessageBox.Show(Page, "标题至少四个字哦");
        }
        else if (txtContent.Text.Equals(""))
        {
            Wozuji.Common.MessageBox.Show(Page, "内容还没输呢");
        }
        else {
            Wozuji.Logic.UserPost up = new Wozuji.Logic.UserPost();
            int nid = up.addPost(title.Text.ToString(), txtContent.Text.ToString(), openconfig.SelectedItem.Value, target.Text.ToString(), setconfig.SelectedItem.Value);
                    
            Response.Redirect("/share/showInfo.aspx?nid=" + nid);
            
        }
    }
}
